package com.killer.edu.oauth.mult.authenticator;

import com.killer.edu.oauth.mult.MultAuthentication;
import com.killer.edu.user.api.dto.UserDTO;

import javax.servlet.http.HttpServletResponse;

/**
 * 集成认证顶级接口  下面有不同的实现如用户名密码认证，微信认证等
 */
public interface MultAuthenticator {

    /**
     * 处理集成认证
     * @param multAuthentication
     * @return
     */
    UserDTO authenticate(MultAuthentication multAuthentication);

    /**
     * 进行预处理
     * @param multAuthentication
     * @param response
     */
    void prepare(MultAuthentication multAuthentication, HttpServletResponse response);

    /**
     * 判断是否支持集成认证类型
     * @param multAuthentication
     * @return
     */
    boolean support(MultAuthentication multAuthentication);

    /**
     * 认证结束后执行
     * @param multAuthentication
     */
    void complete(MultAuthentication multAuthentication);
}
